.class public Lcom/waiqin365/lightapp/syorder/c/a;
.super Ljava/lang/Object;

# interfaces
.implements Landroid/text/TextWatcher;


# instance fields
.field private a:D

.field private b:D

.field private c:Landroid/widget/EditText;

.field private d:Ljava/lang/String;

.field private e:Ljava/lang/String;

.field private f:Z

.field private g:Z

.field private h:I


# direct methods
.method public constructor <init>(DDLandroid/widget/EditText;Ljava/lang/String;Ljava/lang/String;)V
    .locals 1

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/waiqin365/lightapp/syorder/c/a;->g:Z

    const/4 v0, 0x2

    iput v0, p0, Lcom/waiqin365/lightapp/syorder/c/a;->h:I

    iput-wide p1, p0, Lcom/waiqin365/lightapp/syorder/c/a;->a:D

    iput-wide p3, p0, Lcom/waiqin365/lightapp/syorder/c/a;->b:D

    iput-object p6, p0, Lcom/waiqin365/lightapp/syorder/c/a;->d:Ljava/lang/String;

    iput-object p7, p0, Lcom/waiqin365/lightapp/syorder/c/a;->e:Ljava/lang/String;

    iput-object p5, p0, Lcom/waiqin365/lightapp/syorder/c/a;->c:Landroid/widget/EditText;

    if-nez p5, :cond_0

    :cond_0
    return-void
.end method

.method private a(Landroid/text/Editable;)V
    .locals 8

    const/4 v7, 0x2

    const-wide/16 v0, 0x0

    const/4 v6, 0x1

    invoke-virtual {p1}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v2

    const-string/jumbo v3, "."

    invoke-virtual {v2, v3}, Ljava/lang/String;->lastIndexOf(Ljava/lang/String;)I

    move-result v2

    if-ne v2, v6, :cond_1

    invoke-virtual {p1}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v2

    const-string/jumbo v3, "."

    invoke-virtual {v2, v3}, Ljava/lang/String;->endsWith(Ljava/lang/String;)Z

    move-result v2

    if-eqz v2, :cond_1

    iput-boolean v6, p0, Lcom/waiqin365/lightapp/syorder/c/a;->f:Z

    :cond_0
    :goto_0
    return-void

    :cond_1
    invoke-virtual {p1}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v2

    const-string/jumbo v3, "."

    invoke-virtual {v2, v3}, Ljava/lang/String;->lastIndexOf(Ljava/lang/String;)I

    move-result v2

    const/4 v3, -0x1

    if-eq v2, v3, :cond_4

    invoke-virtual {p1}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/String;->length()I

    move-result v2

    invoke-virtual {p1}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v3

    const-string/jumbo v4, "."

    invoke-virtual {v3, v4}, Ljava/lang/String;->lastIndexOf(Ljava/lang/String;)I

    move-result v3

    sub-int/2addr v2, v3

    iget v3, p0, Lcom/waiqin365/lightapp/syorder/c/a;->h:I

    add-int/lit8 v3, v3, 0x1

    if-gt v2, v3, :cond_2

    iget v2, p0, Lcom/waiqin365/lightapp/syorder/c/a;->h:I

    if-gtz v2, :cond_4

    :cond_2
    invoke-direct {p0, p1}, Lcom/waiqin365/lightapp/syorder/c/a;->b(Landroid/text/Editable;)V

    iget-boolean v0, p0, Lcom/waiqin365/lightapp/syorder/c/a;->g:Z

    if-eqz v0, :cond_3

    const-string/jumbo v0, "\u53ea\u80fd\u8f93\u5165\u4e24\u4f4d\u5c0f\u6570!"

    iget-object v1, p0, Lcom/waiqin365/lightapp/syorder/c/a;->c:Landroid/widget/EditText;

    invoke-virtual {v1}, Landroid/widget/EditText;->getContext()Landroid/content/Context;

    move-result-object v1

    invoke-static {v0, v1}, Lcom/waiqin365/lightapp/product/e/b;->a(Ljava/lang/String;Landroid/content/Context;)V

    :cond_3
    iput-boolean v6, p0, Lcom/waiqin365/lightapp/syorder/c/a;->f:Z

    goto :goto_0

    :cond_4
    invoke-virtual {p1}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-static {v2}, Ljava/lang/Double;->parseDouble(Ljava/lang/String;)D

    move-result-wide v2

    iget-wide v4, p0, Lcom/waiqin365/lightapp/syorder/c/a;->a:D

    cmpg-double v2, v2, v4

    if-gez v2, :cond_9

    :try_start_0
    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    const/4 v3, 0x0

    invoke-interface {p1}, Landroid/text/Editable;->length()I

    move-result v4

    add-int/lit8 v4, v4, -0x1

    invoke-interface {p1, v3, v4}, Landroid/text/Editable;->subSequence(II)Ljava/lang/CharSequence;

    move-result-object v3

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v2

    const-string/jumbo v3, ""

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-static {v2}, Ljava/lang/Double;->parseDouble(Ljava/lang/String;)D
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    move-result-wide v0

    :goto_1
    iget-wide v2, p0, Lcom/waiqin365/lightapp/syorder/c/a;->a:D

    cmpl-double v0, v0, v2

    if-lez v0, :cond_7

    invoke-direct {p0, p1}, Lcom/waiqin365/lightapp/syorder/c/a;->b(Landroid/text/Editable;)V

    :cond_5
    :goto_2
    iget-boolean v0, p0, Lcom/waiqin365/lightapp/syorder/c/a;->g:Z

    if-eqz v0, :cond_6

    iget-object v0, p0, Lcom/waiqin365/lightapp/syorder/c/a;->d:Ljava/lang/String;

    iget-object v1, p0, Lcom/waiqin365/lightapp/syorder/c/a;->c:Landroid/widget/EditText;

    invoke-virtual {v1}, Landroid/widget/EditText;->getContext()Landroid/content/Context;

    move-result-object v1

    invoke-static {v0, v1}, Lcom/waiqin365/lightapp/product/e/b;->a(Ljava/lang/String;Landroid/content/Context;)V

    :cond_6
    iput-boolean v6, p0, Lcom/waiqin365/lightapp/syorder/c/a;->f:Z

    goto/16 :goto_0

    :catch_0
    move-exception v2

    invoke-virtual {v2}, Ljava/lang/Exception;->printStackTrace()V

    goto :goto_1

    :cond_7
    iget-boolean v0, p0, Lcom/waiqin365/lightapp/syorder/c/a;->g:Z

    if-eqz v0, :cond_5

    iget-object v0, p0, Lcom/waiqin365/lightapp/syorder/c/a;->c:Landroid/widget/EditText;

    invoke-virtual {v0}, Landroid/widget/EditText;->getInputType()I

    move-result v0

    if-ne v0, v7, :cond_8

    iget-object v0, p0, Lcom/waiqin365/lightapp/syorder/c/a;->c:Landroid/widget/EditText;

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    iget-wide v2, p0, Lcom/waiqin365/lightapp/syorder/c/a;->a:D

    double-to-int v2, v2

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string/jumbo v2, ""

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Landroid/widget/EditText;->setText(Ljava/lang/CharSequence;)V

    :goto_3
    iget-object v0, p0, Lcom/waiqin365/lightapp/syorder/c/a;->c:Landroid/widget/EditText;

    iget-object v1, p0, Lcom/waiqin365/lightapp/syorder/c/a;->c:Landroid/widget/EditText;

    invoke-virtual {v1}, Landroid/widget/EditText;->getText()Landroid/text/Editable;

    move-result-object v1

    invoke-interface {v1}, Landroid/text/Editable;->length()I

    move-result v1

    invoke-virtual {v0, v1}, Landroid/widget/EditText;->setSelection(I)V

    goto :goto_2

    :cond_8
    iget-object v0, p0, Lcom/waiqin365/lightapp/syorder/c/a;->c:Landroid/widget/EditText;

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    iget-wide v2, p0, Lcom/waiqin365/lightapp/syorder/c/a;->a:D

    invoke-virtual {v1, v2, v3}, Ljava/lang/StringBuilder;->append(D)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string/jumbo v2, ""

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Landroid/widget/EditText;->setText(Ljava/lang/CharSequence;)V

    goto :goto_3

    :cond_9
    invoke-virtual {p1}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-static {v2}, Ljava/lang/Double;->parseDouble(Ljava/lang/String;)D

    move-result-wide v2

    iget-wide v4, p0, Lcom/waiqin365/lightapp/syorder/c/a;->b:D

    cmpl-double v2, v2, v4

    if-lez v2, :cond_0

    :try_start_1
    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    const/4 v3, 0x0

    invoke-interface {p1}, Landroid/text/Editable;->length()I

    move-result v4

    add-int/lit8 v4, v4, -0x1

    invoke-interface {p1, v3, v4}, Landroid/text/Editable;->subSequence(II)Ljava/lang/CharSequence;

    move-result-object v3

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v2

    const-string/jumbo v3, ""

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-static {v2}, Ljava/lang/Double;->parseDouble(Ljava/lang/String;)D
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_1

    move-result-wide v0

    :goto_4
    iget-wide v2, p0, Lcom/waiqin365/lightapp/syorder/c/a;->b:D

    cmpg-double v0, v0, v2

    if-gtz v0, :cond_c

    invoke-direct {p0, p1}, Lcom/waiqin365/lightapp/syorder/c/a;->b(Landroid/text/Editable;)V

    :cond_a
    :goto_5
    iget-boolean v0, p0, Lcom/waiqin365/lightapp/syorder/c/a;->g:Z

    if-eqz v0, :cond_b

    iget-object v0, p0, Lcom/waiqin365/lightapp/syorder/c/a;->e:Ljava/lang/String;

    iget-object v1, p0, Lcom/waiqin365/lightapp/syorder/c/a;->c:Landroid/widget/EditText;

    invoke-virtual {v1}, Landroid/widget/EditText;->getContext()Landroid/content/Context;

    move-result-object v1

    invoke-static {v0, v1}, Lcom/waiqin365/lightapp/product/e/b;->a(Ljava/lang/String;Landroid/content/Context;)V

    :cond_b
    iput-boolean v6, p0, Lcom/waiqin365/lightapp/syorder/c/a;->f:Z

    goto/16 :goto_0

    :catch_1
    move-exception v2

    invoke-virtual {v2}, Ljava/lang/Exception;->printStackTrace()V

    goto :goto_4

    :cond_c
    iget-boolean v0, p0, Lcom/waiqin365/lightapp/syorder/c/a;->g:Z

    if-eqz v0, :cond_a

    iget-object v0, p0, Lcom/waiqin365/lightapp/syorder/c/a;->c:Landroid/widget/EditText;

    invoke-virtual {v0}, Landroid/widget/EditText;->getInputType()I

    move-result v0

    if-ne v0, v7, :cond_d

    iget-object v0, p0, Lcom/waiqin365/lightapp/syorder/c/a;->c:Landroid/widget/EditText;

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    iget-wide v2, p0, Lcom/waiqin365/lightapp/syorder/c/a;->b:D

    double-to-int v2, v2

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string/jumbo v2, ""

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Landroid/widget/EditText;->setText(Ljava/lang/CharSequence;)V

    :goto_6
    iget-object v0, p0, Lcom/waiqin365/lightapp/syorder/c/a;->c:Landroid/widget/EditText;

    iget-object v1, p0, Lcom/waiqin365/lightapp/syorder/c/a;->c:Landroid/widget/EditText;

    invoke-virtual {v1}, Landroid/widget/EditText;->getText()Landroid/text/Editable;

    move-result-object v1

    invoke-interface {v1}, Landroid/text/Editable;->length()I

    move-result v1

    invoke-virtual {v0, v1}, Landroid/widget/EditText;->setSelection(I)V

    goto :goto_5

    :cond_d
    iget-object v0, p0, Lcom/waiqin365/lightapp/syorder/c/a;->c:Landroid/widget/EditText;

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    iget-wide v2, p0, Lcom/waiqin365/lightapp/syorder/c/a;->b:D

    invoke-virtual {v1, v2, v3}, Ljava/lang/StringBuilder;->append(D)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string/jumbo v2, ""

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Landroid/widget/EditText;->setText(Ljava/lang/CharSequence;)V

    goto :goto_6
.end method

.method private b(Landroid/text/Editable;)V
    .locals 3

    iget-object v0, p0, Lcom/waiqin365/lightapp/syorder/c/a;->c:Landroid/widget/EditText;

    if-eqz v0, :cond_0

    iget-boolean v0, p0, Lcom/waiqin365/lightapp/syorder/c/a;->g:Z

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/waiqin365/lightapp/syorder/c/a;->c:Landroid/widget/EditText;

    const/4 v1, 0x0

    invoke-interface {p1}, Landroid/text/Editable;->length()I

    move-result v2

    add-int/lit8 v2, v2, -0x1

    invoke-interface {p1, v1, v2}, Landroid/text/Editable;->subSequence(II)Ljava/lang/CharSequence;

    move-result-object v1

    invoke-virtual {v0, v1}, Landroid/widget/EditText;->setText(Ljava/lang/CharSequence;)V

    iget-object v0, p0, Lcom/waiqin365/lightapp/syorder/c/a;->c:Landroid/widget/EditText;

    iget-object v1, p0, Lcom/waiqin365/lightapp/syorder/c/a;->c:Landroid/widget/EditText;

    invoke-virtual {v1}, Landroid/widget/EditText;->getText()Landroid/text/Editable;

    move-result-object v1

    invoke-interface {v1}, Landroid/text/Editable;->length()I

    move-result v1

    invoke-virtual {v0, v1}, Landroid/widget/EditText;->setSelection(I)V

    :cond_0
    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/waiqin365/lightapp/syorder/c/a;->f:Z

    return-void
.end method


# virtual methods
.method public a(D)V
    .locals 1

    iput-wide p1, p0, Lcom/waiqin365/lightapp/syorder/c/a;->b:D

    return-void
.end method

.method public a()Z
    .locals 1

    iget-boolean v0, p0, Lcom/waiqin365/lightapp/syorder/c/a;->f:Z

    return v0
.end method

.method public afterTextChanged(Landroid/text/Editable;)V
    .locals 3

    const/4 v2, 0x1

    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/waiqin365/lightapp/syorder/c/a;->f:Z

    invoke-static {p1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v0

    if-nez v0, :cond_1

    invoke-virtual {p1}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v0

    const-string/jumbo v1, "-"

    invoke-virtual {v0, v1}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v0

    if-nez v0, :cond_0

    invoke-virtual {p1}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v0

    const-string/jumbo v1, "+"

    invoke-virtual {v0, v1}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v0

    if-nez v0, :cond_0

    invoke-virtual {p1}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v0

    const-string/jumbo v1, "."

    invoke-virtual {v0, v1}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_3

    :cond_0
    invoke-virtual {p1}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/String;->length()I

    move-result v0

    if-le v0, v2, :cond_2

    invoke-direct {p0, p1}, Lcom/waiqin365/lightapp/syorder/c/a;->a(Landroid/text/Editable;)V

    :cond_1
    :goto_0
    return-void

    :cond_2
    iput-boolean v2, p0, Lcom/waiqin365/lightapp/syorder/c/a;->f:Z

    goto :goto_0

    :cond_3
    invoke-direct {p0, p1}, Lcom/waiqin365/lightapp/syorder/c/a;->a(Landroid/text/Editable;)V

    goto :goto_0
.end method

.method public beforeTextChanged(Ljava/lang/CharSequence;III)V
    .locals 0

    return-void
.end method

.method public onTextChanged(Ljava/lang/CharSequence;III)V
    .locals 0

    return-void
.end method
